<?php
class packchannelControl extends Control{
    //列表显示
    public function list_show(){
        $_GET['sm']=8;
        $_GET['menu']=3;
        $db=M('category');      
        if(isset($_GET['catid'])&&$_GET['catid']==1){
            $game=$db->all("pid=3");
            $game=  get_packcount($game);
            $soft=$db->all("pid=4");
            $soft=  get_packcount($soft);
            $net=$db->all("pid=5");
            $net=  get_packcount($net);
            $this->assign("game", $game);
            $this->assign("soft", $soft);
            $this->assign("net", $net);
            $this->display();
        }else{
            go(__APP__.'/index');
        }
    }
    //添加显示
    public function add_show(){
        $_GET['sm']=8;
        $_GET['menu']=3;
        if(isset($_GET['catid'])&&in_array($_GET['catid'],array(3,4,5))){
            $this->display();
        }else{
            go(__APP__.'/index');
        }        
    }
    //添加
    public function add(){
        $db=M("category");
        $db->add();
        go(__CONTROL__.'/list_show/catid/1');
    }
}
?>
